﻿using System.ComponentModel;
using System.Windows.Threading;

namespace Requestor.TestApp
{
    public abstract class ViewModelBase : INotifyPropertyChanged
    {
        #region Члены INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        public Dispatcher Dispatcher { get; private set; }

        protected ViewModelBase(Dispatcher dispatcher)
        {
            Dispatcher = dispatcher;
        }
    }
}